<div ng-include src="'views/sidebar.html'"></div>
<section id="page-wrapper" ng-init="init()">
  <form class="form-horizontal">
    <div class="modal-header" style="position:relative;">
      <h3 class="modal-title">子模块信息</h3>
      <a class="btn btn-success" ng-click="submoduleEdit(null, $event, false)" tabindex="0" style="position: absolute;top: 10px;right: 10px;"><i class="fa fa-plus"></i>添加</a>
    </div>
    <div class="modal-body">
      <div class="form-group">
        <ul class="row">
          <li ng-repeat="subModule in subModuleList" class="list-unstyled col-md-3">
            <div class="panel panel-default">
              <div class="panel-heading clearfix">
                <div class="btn-group pull-right" role="group" aria-label="...">
                  <button ng-click="submoduleEdit(subModule, $event, true)" class="btn btn-default btn-xs">
                  <i class="fa fa-edit"></i>
                  </button>
                </div>
                <div class="panel-title">{{subModule.description}}({{subModule.id}})</div>
              </div>
              <div class="panel-body">
                <ol>
                  <li ng-repeat="field in subModule.showFields">{{field.fieldName}}({{field.fieldDescription}})</li>
                </ol>

              </div>
            </div>
          </div>
        </li>
      </ul>
    </div>
  </form>
</section>
<script type="text/ng-template" id="modal.submodule.info.html">
  <input type="file" style="display:none;" id="fileuploader" />
  <style>.ace_editor { height: 200px; }</style>
  <form class="form-horizontal" name="myForm" ng-init="init()">
    <div class="modal-header">
      <h3 class="modal-title">子模块详情</h3>
    </div>
    <div class="modal-body">
      <div class="form-group">
        <label class="col-sm-2 control-label">处理器</label>
          <div class="col-sm-10">
            <select class="form-control" ng-model="subModule.cmsDataProcessor" multiple>
              <option value="{{process.beanName}}" ng-repeat="process in processList" ng-selected="temArray[$index]">{{process.description}}</option>
            </select>
          </div>
      </div>
      <div class="form-group">
        <label class="col-sm-2 control-label">自动同步</label>
          <div class="col-sm-10">
           <select class="form-control" ng-model="subModule.autoSync" >
           <option value="0">否</option>
           <option value="1">是</option>
          </select>
          </div>
      </div>
      <div class="form-group">
        <label class="col-sm-2 control-label">模块说明</label>
          <div class="col-sm-10">
            <input type="text" class="form-control" ng-model="subModule.description">
          </div>
      </div>
     <div class="form-group">
        <label class="col-sm-2 control-label">选择字段</label>
          <div class="col-sm-10">
            <label ng-repeat="field in allfields" class="checkbox-inline"><input type="checkbox"  ng-checked="field.checked" ng-click="changeValue(field)">{{field.fieldDescription}}</label>
            </div>
      </div>
      <div class="modal-footer">
        <button class="btn btn-success" ng-if="isEdit == true" ng-click="save(subModule)" type="submit">修改</button>
        <button class="btn btn-success" ng-if="isEdit == false" ng-click="add(subModule)" type="submit">添加</button>
        <button class="btn btn-default" ng-click="cancel()">取消</button>
      </div>
    </div>
  </form>
</script>
